import { createStore } from 'redux';
const initialState = {
    name: '张三',
};
// 定义reducer函数
const appReducer = (state = initialState, action) => {
    console.log('action: ', action);
    const { type, payload } = action;
    switch (type) {
        case 'changeName':
            return { ...state, name: payload };
        default:
            return state;
    }
};
const store = createStore(appReducer);
export default store;
